CREATE TABLE [Category]
(
  [CategoryId] NVARCHAR(150) NOT NULL PRIMARY KEY ,
  [Name] NVARCHAR(150) NOT NULL  ,
  [Descn] NVARCHAR(150) NULL 
);

CREATE TABLE [Inventory]
(
  [ItemId] NVARCHAR(150) NOT NULL PRIMARY KEY ,
  [Qty] INTEGER NOT NULL 
);

CREATE TABLE [Item]
(
  [ItemId] NVARCHAR(150) NOT NULL PRIMARY KEY ,
  [ProductId] NVARCHAR(150) NOT NULL  ,
  [ListPrice] NUMERIC NULL  ,
  [UnitCost] NUMERIC NULL  ,
  [Supplier] INTEGER NULL  ,
  [Status] NVARCHAR(150) NULL  ,
  [Name] NVARCHAR(150) NULL  ,
  [Image] NVARCHAR(150) NULL 
);

CREATE TABLE [Product]
(
  [ProductId] NVARCHAR(150) NOT NULL PRIMARY KEY ,
  [CategoryId] NVARCHAR(150) NOT NULL  ,
  [Name] NVARCHAR(150) NULL  ,
  [Descn] NVARCHAR(150) NULL  ,
  [Image] NVARCHAR(150) NULL 
);

CREATE TABLE [Supplier]
(
  [SuppId] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  [Name] NVARCHAR(150) NULL  ,
  [Status] NVARCHAR(150) NOT NULL  ,
  [Addr1] NVARCHAR(150) NULL  ,
  [Addr2] NVARCHAR(150) NULL  ,
  [City] NVARCHAR(150) NULL  ,
  [State] NVARCHAR(150) NULL  ,
  [Zip] NVARCHAR(150) NULL  ,
  [Phone] NVARCHAR(150) NULL 
);

CREATE TABLE [DAC_ISSUE]
(
  [ISSUE_ID] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  [ISSUE_TITLE] NVARCHAR(255) NOT NULL  ,
  [ISSUE_DESC] NVARCHAR(2000) NULL  ,
  [ISSUE_STS] INTEGER NOT NULL  ,
  [ISSUE_TYP] NVARCHAR(50) NULL  ,
  [ISSUE_OWNR] NVARCHAR(50) NULL  ,
  [ISSUE_PRGS] NUMERIC NULL  ,
  [CREATE_TM] DATE NOT NULL  ,
  [ISSUE_LOCKED] INTEGER NULL 
);

CREATE TABLE [DAC_USER]
(
  [USER_ID] NVARCHAR(50) NOT NULL PRIMARY KEY ,
  [USERNAME] NVARCHAR(50) NOT NULL  ,
  [FULLNAME] NVARCHAR(255) NULL  ,
  [USER_PWD] NVARCHAR(50) NULL  ,
  [CHANGINGPWD] INTEGER NULL  ,
  [USERLOCKED] INTEGER NULL  ,
  [LASTLOGIN] DATE NULL  ,
  [USER_DESC] NVARCHAR(2000) NULL 
);

CREATE TABLE [DAC_MUTIPLEKEYS]
(
  [DAC_KEY1] NVARCHAR(50) NOT NULL PRIMARY KEY ,
  [DAC_KEY2] NVARCHAR(50) NOT NULL PRIMARY KEY ,
  [DAC_VALUE1] NVARCHAR(50) NULL  ,
  [DAC_VALUE2] NVARCHAR(50) NULL 
);

